<template>
  <div class="dialog-role">
    <el-dialog
      :visible.sync="dialogVisible"
      :title="field"
      width="800px"
      @close="handleClose"
    >
      <el-form
        ref="ruleForm"
        :model="ruleForm"
        :rules="rules"
        label-width="100px"
        class="dialog-ruleForm"
      >
        <el-form-item label="设备类别">
          <el-input v-model="ruleForm.name" clearable />
        </el-form-item>
        <el-form-item label="版本号">
          <el-input v-model="ruleForm.name" clearable />
        </el-form-item>
        <el-form-item label="更新内容说明">
          <el-input v-model="ruleForm.name" clearable type="textarea" />
        </el-form-item>
        <el-form-item label="下载链接">
          <UploadFile></UploadFile>
        </el-form-item>
        <el-form-item label="备注信息:">
          <el-input v-model="ruleForm.name" type="textarea" />
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="dialogVisible = false"
          >确 定</el-button
        >
      </span>
    </el-dialog>
   
  </div>
</template>

<script>
import UploadFile from "@/views/qiniu/upload.vue"

export default {

  props: {
    value: {
      type: Boolean,
      default: false,
    },
    field: {
      type: String,
      default: "",
    },

  },
  components: {
    UploadFile,
  },

  data() {
   
    return {
      ruleForm: {
        name: "",
      },
      rules: {
        name: [
          { required: true, message: "请输入活动名称", trigger: "blur" },
          { min: 3, max: 5, message: "长度在 3 到 5 个字符", trigger: "blur" },
        ],
      },  
    };
  },
  computed: {
    dialogVisible: {
      get() {
        return this.value;
      },
      set(val) {
        this.$emit("close", val);
      },
    },
  },
  watch: {
    
  },
  mounted() {
   
  },
  methods: {
    handleClose() {
      this.dialogVisible = false;
      this.$emit("close");
    },

  
  },
};
</script>

<style scoped lang="scss">
.dialog-role {
  .dialog-ruleForm {
    width: 80%;
    line-height: 60px;
    margin: 0 auto;
  }
  .menu-permisssion {
    border: 1px solid #dcdfe6;
    padding: 15px;
    border-radius: 4px;
  }
}
</style>
